package com.aaa.outbound.feign;

import com.aaa.entity.stock.Stock;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "stock-service")
public interface StockFeign {
    @PostMapping("/stock/stock/selectSumUqtyByCommoditybar")
    @ApiOperation(value = "根据商品编码和仓库ID查询可用商品数量")
    public Integer selectSumUqtyByCommoditybar(@ApiParam(value = "商品编码") @RequestParam String commoditybar,@ApiParam(value = "仓库ID")@RequestParam Long warehouseid);

    @PostMapping("/stock/stock/updateById")
    @ApiOperation("根据传入stock的实体id更新该stock")
    public Boolean updateById(@RequestBody Stock stock);

    @PostMapping("/stock/stock/selectStockByCommoditybar")
    @ApiOperation(value = "根据商品编码和仓库ID查询库存")
    public List<Stock> selectStockByCommoditybar(@ApiParam(value = "商品编码") @RequestParam String commoditybar, @ApiParam(value = "仓库ID")@RequestParam Long warehouseid);


    /*通过商品编名称和仓库id查出对应的一个库存*/
    @GetMapping("/stock/stock/selectStockByComBarOriLo")
    @ApiOperation("通过商品编名称和仓库id查出对应的一个库存")
    public Stock selectStockByComBarOriLo(@RequestParam String commoditybar, @RequestParam String locatorcode, @RequestParam Long warehouseid);


    @PostMapping("/stock/stock/selectStockByCommodity")
    @ApiOperation("根据货位编码和商品编码获取一个Stock")
    public Stock selectStockByCommodity(@RequestParam String locatorcode,@RequestParam String commoditybar);
}
